// i.d(t, {
//   Ey: () => n,
//   tU: () => a,
//   Lm: () => o,
//   Bw: () => l,
//   Ae: () => r
// })

import viewmodeEnum from "../enum/viewmode.enum"
import { ViewmodeConvertException } from "../exception/viewmode.exception"

export const getViewName = e => {
  switch (e) {
    case viewmodeEnum.Panorama:
      return "Panorama"
    case viewmodeEnum.Floorplan:
      return "Floorplan"
    case viewmodeEnum.Dollhouse:
      return "Dollhouse"
    case viewmodeEnum.Transition:
      return "Transition"
    case viewmodeEnum.Orthographic:
      return "Orthographic"
    case viewmodeEnum.Mesh:
      return "Mesh"
  }
  return "Unknown"
}
export const workToView = e => {
  switch (e) {
    case "0":
    case 0:
      return viewmodeEnum.Panorama
    case "1":
    case 1:
      return viewmodeEnum.Floorplan
    case "2":
    case 2:
      return viewmodeEnum.Dollhouse
    case "3":
    case 3:
      return viewmodeEnum.Transition
  }
  throw new ViewmodeConvertException("No known conversion for Workshop int to viewmode for int: " + e, e)
}
export function viewToWork(e) {
  switch (e) {
    case viewmodeEnum.Panorama:
      return 0
    case viewmodeEnum.Floorplan:
      return 1
    case viewmodeEnum.Dollhouse:
      return 2
    case viewmodeEnum.Transition:
      return 3
  }
  throw new ViewmodeConvertException("No known conversion for Viewmode to Workshop int", e)
}
export function isPanOrMesh(e: number) {
  return e === viewmodeEnum.Panorama || e === viewmodeEnum.Mesh
}
export default {
  Ey: viewmodeEnum,
  tU: viewToWork,
  Lm: workToView,
  Bw: isPanOrMesh,
  Ae: getViewName
}
